package springdao;

import java.util.Collection;
import java.util.List;
import java.util.Map;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

/**
 *
 * @author Kent Yeh
 */
@Transactional(readOnly = true)
public class AnnotatedRepositoryManager<E> extends RepositoryManager<E> {

    @Override
    @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
    public int bulkUpdate(String QL) {
        return super.bulkUpdate(QL);
    }

    @Override
    @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
    public List bulkUpdate(List QLs) {
        return super.bulkUpdate(QLs);
    }

    @Override
    @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
    public int bulkUpdate(String QL, Object... parameters) {
        return super.bulkUpdate(QL, parameters);
    }

    @Override
    @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
    public int bulkUpdate(String QL, Map<String, ?> parameters) {
        return super.bulkUpdate(QL, parameters);
    }

    @Override
    @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
    public E merge(E entity) {
        return super.merge(entity);
    }

    @Override
    @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
    public Collection merge(Collection entity) {
        return super.merge(entity);
    }

    @Override
    @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
    public E merge(String entityName, E entity) {
        return super.merge(entityName, entity);
    }

    @Override
    @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
    public E persist(E entity) {
        return super.persist(entity);
    }

    @Override
    @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
    public E persist(String entityName, E entity) {
        return super.persist(entityName, entity);
    }

    @Override
    @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
    public void remove(E entity, String lockMode) {
        super.remove(entity, lockMode);
    }

    @Override
    @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
    public void remove(E entity) {
        super.remove(entity);
    }

    @Override
    @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
    public void remove(Collection<E> entities) {
        super.remove(entities);
    }

    @Override
    @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
    public E save(E entity) {
        return super.save(entity);
    }

    @Override
    @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
    public Collection save(Collection entities) {
        return super.save(entities);
    }

    @Override
    @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
    public E saveOrUpdate(E entity) {
        return super.saveOrUpdate(entity);
    }

    @Override
    @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
    public E saveOrUpdate(String entityName, E entity) {
        return super.saveOrUpdate(entityName, entity);
    }

    @Override
    @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
    public Collection saveOrUpdate(Collection entities) {
        return super.saveOrUpdate(entities);
    }

    @Override
    public void setDao(DaoRepository dao) {
        super.setDao(dao);
    }

    @Override
    @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
    public E update(E entity) {
        return super.update(entity);
    }

    @Override
    @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
    public E update(E entity, String lockMode) {
        return super.update(entity, lockMode);
    }

    @Override
    @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
    public Collection update(Collection entities) {
        return super.update(entities);
    }
}
